package com.qfedu.luck.controller;

import com.alibaba.fastjson.JSON;
import com.qfedu.luck.listener.SessionListener;
import com.qfedu.luck.vo.R;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @program: LuckStudy
 * @description:
 * @author: Feri(邢朋辉)
 * @create: 2021-02-24 15:16
 */
@WebServlet("/api/user/online.do")
public class UserOnLineServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("application/json;charset=UTF-8");
        resp.getWriter().print(JSON.toJSONString(R.ok(SessionListener.nums)));
    }
}
